package my.service;

import java.sql.SQLException;
import java.util.List;

import my.bean.Order;

public interface IOrderService {
	/**
	 * add an order into ORDER
	 * @param order
	 * @return the count of order successfully insert into
	 * @throws SQLException
	 */
	public int addOrder(Order order) throws SQLException;

	/**
	 * delete an order by a given id
	 * @param id
	 * @return the count of order successfully delete
	 * @throws SQLException
	 */
	public int deleteOrderById(int id) throws SQLException;

	// public int modifyOrder(Order order) throws SQLException;
	/**
	 * find all the order record
	 * @return a list of all order
	 */
	public List<Order> findAll();

	/**
	 * find the list of order by user's id
	 * @param id
	 * @return a list of order
	 */
	public List<Order> findByUserid(int id);

	/**
	 * find the list of order by tea's id
	 * @param id
	 * @return a list of order
	 */
	public List<Order> findByTeaId(int id);

	/**
	 * find the list of order by tea's id and user's id
	 * @param uId
	 * @param tId
	 * @return a list of oreder
	 */
	public List<Order> findByTeaIdAndUserID(int uId, int tId);

	/**
	 * find the list of order by tea'type
	 * @param type
	 * @return
	 */
	public List<Order> findByTeaType(int type);
	
	public Order findByOrderId(int id);
}
